---
title: Create your first app
description: In this chapter, learn how to create a new Expo project.
hasVideoLink: true
---

import { Download03Icon } from '@expo/styleguide-icons/outline/Download03Icon';

import { BoxLink } from '~/ui/components/BoxLink';
import { Collapsible } from '~/ui/components/Collapsible';
import { ContentSpotlight } from '~/ui/components/ContentSpotlight';
import { ProgressTracker } from '~/ui/components/ProgressTracker';
import { Terminal } from '~/ui/components/Snippet';
import { Step } from '~/ui/components/Step';
import { CODE } from '~/ui/components/Text';
import { VideoBoxLink } from '~/ui/components/VideoBoxLink';

In this chapter, let's learn how to create a new Expo project and how to get it running.

<VideoBoxLink videoId="m1-bc53EGh8" title="Watch: Creating your first universal Expo app" />

---

## Prerequisites

We'll need the following to get started:

- [Expo Go](https://expo.dev/go) installed on a physical device
- [Node.js (LTS version)](https://nodejs.org/en) installed
- [VS Code](https://code.visualstudio.com/) or any other preferred code editor or IDE installed
- A macOS, Linux, or Windows (PowerShell and [WSL2](https://expo.fyi/wsl)) with a terminal window open

The tutorial assumes that you are familiar with TypeScript and React. If you are not familiar with them, check out the [TypeScript Handbook](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html) and [React's official tutorial](https://react.dev/learn).

<Step label="1">

## Initialize a new Expo app

We'll use [`create-expo-app`](/more/create-expo/) to initialize a new Expo app. It is a command line tool to create a new React Native project. Run the following command in your terminal:

<Terminal
  cmd={[
    '# Create a project named StickerSmash',
    '$ npx create-expo-app@latest StickerSmash',
    '',
    '# Navigate to the project directory',
    '$ cd StickerSmash',
  ]}
  cmdCopy="npx create-expo-app@latest StickerSmash && cd StickerSmash"
/>

This command will create a new project directory named StickerSmash, using the [default](/more/create-expo/#--template) template. This template has essential boilerplate code and libraries needed to build our app, including Expo Router. We'll continue to add more libraries throughout this tutorial as needed.

<Collapsible summary="Benefits of using the default template">

- Creates a new React Native project with `expo` package installed
- Includes recommended tools such as Expo CLI
- Includes a tab navigator from Expo Router to provide a basic navigation system
- Automatically configured to run a project on multiple platforms: Android, iOS, and web
- TypeScript configured by default

</Collapsible>

</Step>

<Step label="2">

## Download assets

<BoxLink
  title="Download assets archive"
  Icon={Download03Icon}
  description="We'll be using these assets throughout this tutorial."
  href="/static/images/tutorial/sticker-smash-assets.zip"
/>

After downloading the archive:

1. Unzip the archive and replace the default assets in the **your-project-name/assets/images** directory.
2. Open the project directory in a code editor or IDE.

</Step>

<Step label="3">

## Run reset-project script

In this tutorial, we'll build our app from scratch and understand the fundamentals of adding a file-based navigation. Let's run the `reset-project` script to remove the boilerplate code:

<Terminal cmd={['$ npm run reset-project']} />

After running the above command, there are two files (**index.tsx** and **\_layout.tsx**) left inside the **app** directory. The previous files from **app** and other directories (**components**, **constants**, and **hooks** &mdash; containing boilerplate code) are moved inside the **app-example** directory by the script. We'll create our own directories and component files as we go along.

<Collapsible summary={<>What does the <CODE>reset-project</CODE> script do?</>}>

`reset-project` script resets the **app** directory structure in a project and copies the previous boilerplate files from the project's root directory to another sub-directory called **app-example**. We can delete it since it is not part of our main app's structure.

</Collapsible>

</Step>

<Step label="4">

## Run the app on mobile and web

In the project directory, run the following command to start the [development server](/more/glossary-of-terms/#development-server) from the terminal:

<Terminal cmd={['$ npx expo start']} />

After running the above command:

1. The development server will start, and you'll see a QR code inside the terminal window.
2. Scan that QR code to open the app on the device. On Android, use the Expo Go > **Scan QR code** option. On iOS, use the default camera app.
3. To run the web app, press <kbd>w</kbd> in the terminal. It will open the web app in the default web browser.

Once it is running on all platforms, the app should look like this:

<ContentSpotlight
  alt="App running on all platforms"
  src="/static/images/tutorial/01-app-running-on-all-platforms.png"
  className="max-w-[720px]"
/>

</Step>

<Step label="5">

## Edit the index screen

The **app/index.tsx** file defines the text displayed on the app's screen. It is the entry point of our app and executes when the development server starts. It uses core React Native components such as `<View>` and `<Text>` to display background and text.

Styles applied to these components use JavaScript objects rather than CSS, which is used on web. However, a lot of the properties will look familiar if you've previously used CSS on web. Most React Native components accept a `style` prop that accepts a JavaScript object as its value. For more details, see [Styling in React Native](https://reactnative.dev/docs/style).

Let's modify **app/index.tsx** screen:

1. Import `StyleSheet` from `react-native` and create a `styles` object to define our custom styles.
2. Add a `styles.container.backgroundColor` property to `<View>` with the value of `#25292e`. This changes the background color.
3. Replace the default value of `<Text>` with "Home screen".
4. Add a `styles.text.color` property to `<Text>` with the value of `#fff` (white) to change the text color.

{/* prettier-ignore */}
```tsx app/index.tsx|collapseHeight=340
import { Text, View, /* @tutinfo Import <CODE>StyleSheet</CODE> to define styles. */ StyleSheet/* @end */ } from 'react-native';

export default function Index() {
  return (
    <View style={styles.container}>
      /* @tutinfo This used to say "Edit app/index.tsx to edit this screen". Now it says, "Home screen". */
      <Text style={styles.text}>Home screen</Text>
      /* @end */
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    /* @tutinfo Add the value of <CODE>backgroundColor</CODE> property with <CODE>'#25292e'</CODE>.*/
    backgroundColor: '#25292e',
    /* @end */
    alignItems: 'center',
    justifyContent: 'center',
  },
  text: {
    color: '#fff',
  },
});
```

> React Native uses the same color format as the web. It supports hex triplets (this is what `#fff` is), `rgba`, `hsl`, and named colors, such as `red`, `green`, `blue`, `peru`, and `papayawhip`. For more information, see [Colors in React Native](https://reactnative.dev/docs/colors).

Once you save your changes, they're sent and applied to the running apps connected to the development server:

<ContentSpotlight
  alt="App with updated text and background color"
  src="/static/images/tutorial/02-index-screen-changes.png"
  className="max-w-[720px]"
/>

</Step>

## Summary

<ProgressTracker
  currentChapterIndex={0}
  name="GET_STARTED"
  summary="We've successfully created a new Expo project, used React Native core components, and are ready to develop our StickerSmash app."
  nextChapterDescription="In the next chapter, we will learn how to add a stack and a tab navigator to our app."
  nextChapterTitle="Add navigation"
  nextChapterLink="/tutorial/add-navigation/"
/>
